package com.jinunn.order.controller;

import com.atguigu.yygh.model.order.OrderInfo;
import com.jinunn.common.result.Result;
import com.jinunn.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : JinDun
 * @date : 2021/5/20 23:33
 */

@RestController
@RequestMapping("/api/order/orderInfo")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     *  生成挂号订单
     */
    @PostMapping("auth/submitOrder/{scheduleId}/{patientId}")
    public Result<Long> savaOrders(@PathVariable String scheduleId,
                                        @PathVariable Long patientId) {
        Long orderId = orderService.saveOrder(scheduleId,patientId);
        return Result.ok(orderId);
    }
}
